<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Manager Class - ACADEMIC CP</title>
        <link rel="stylesheet" type="text/css" href="../style.css" />
    </h:head>
    <f:view>
        <h:body styleClass="body" onload="#{manageAccount.checkAcademic()}">
            <center>
                <br/>
                <div style="width: 90%;background-color: white;border-color: gray">                
                    <table style="width: 100%">
                        <br/>
                        <tr valign="middle">
                            <td colspan="3" align="center">
                                <hr size="2" align="center" style="color: whitesmoke"/></td>
                        </tr>
                        <tr valign="middle" style="height: 10px" >
                            <td colspan="2">
                                <a href="#" class="aLink" style="margin-left:15px"> HOME&nbsp;&nbsp;|</a>
                                <a href="../course.xhtml" class="aLink">&nbsp;&nbsp; COURSE&nbsp;&nbsp; |</a>
                                <a href="#" class="aLink" >&nbsp;&nbsp; ABOUT&nbsp;&nbsp; |</a>
                                <a href="home.xhtml" class="aLink" >&nbsp;&nbsp; ACADEMIC CP</a>
                            </td>
                            <td align="center">
                                <a href="searchMark.xhtml"><img src="../image/Search.png"/></a>
                                <input type="text" style="width: 200px"/>
                            </td>
                        </tr>
                        <tr valign="top">
                            <td colspan="3" align="center"><hr size="2" align="center" style="color: whitesmoke"/></td>
                        </tr>
                        <tr style="height: 98px">
                            <td colspan="2" align="left">
                                <img src="../image/logo8.png"/>
                            </td>
                            <td align="right">                            
                                <img src="../image/tiepnguonsinhkhi2.jpg"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" align="center"><hr size="1" align="center" style="color: gray"/>    </td>
                        </tr>
                        <tr style="height: 20px">
                            <td colspan="2">
                                <a href="manageClass.xhtml" class="blink">Class</a>
                                <a href="manageStudent.xhtml" class="blink">Student</a>
                                <a href="manageMark.xhtml" class="blink">Mark</a>

                            </td>
                           <h:form>
                            <td align="right">
                                Welcome to: <h:outputText value="#{manageAccount.acc.accName}" style="color: red"/>. <h:commandLink value="Logout" action="#{manageAccount.logout()}"/>
                                <img src="../image/help2.png"/>&nbsp;&nbsp;
                                <img src="../image/sys.png"/>
                            </td>
                                </h:form>
                        </tr>
                        <tr>
                            <td colspan="3" align="center">
                                <hr size="3" align="center" style="color: black;background-color: black" noshade="true"/> 
                            </td>
                        </tr>

                    </table>
                    <br/>
                    <table border="0">
                        <tr>
                            <td align="left" style="width: 20%">
                                <hr size="3" align="center" style="color: whitesmoke;" />                                                       
                            </td>
                            <td align="left" style="width: 50%">
                                <hr size="3" align="center" style="color: whitesmoke;" />                            
                            </td>
                            <td align="left" style="width: 20%">
                                <hr  size="3" align="left" style="color: whitesmoke;" />                                                                                  
                            </td>
                        </tr>
                        <tr style="height: 20px">
                            <td align="left" style="width: 20%">
                                <span class="title">Featured Categories</span>
                            </td>
                            <td align="left" style="width: 50%">
                                <span class="title">Recent Posts</span>                          
                            </td>
                            <td align="left" style="width: 20%">
                                <span class="title">Archives</span>
                            </td>
                        </tr>
                        <tr >
                            <td align="left" style="width: 20%">
                                <hr size="3" align="center" style="color: whitesmoke;" />                                                       
                            </td>
                            <td align="left" style="width: 50%">
                                <hr size="3" align="center" style="color: whitesmoke;" />                           
                            </td>
                            <td align="left" style="width: 20%">
                                <hr  size="3" align="left" style="color: whitesmoke" />                                                                                   
                            </td>
                        </tr>


                        <tr valign="top">
                            <td align="left" style="width: 20%">                            
                                <div>  
                                    <h:form>
                                        <h:dataTable value="#{manageContact.list}" var="item" width="100%">                                           
                                            <h:column >                                                
                                                <span class="aLink"><h:outputText value="#{item.contactName}"/></span><br/>
                                                <span class="a1Link"><h:outputText value="#{item.contactPhone}"/></span>
                                                <br/>
                                                <span class="a1Link"><h:outputText value="#{item.contactEmail}"/></span><br/>
                                                <hr size="1" align="center" style="color: whitesmoke" />
                                            </h:column>                                                                                   
                                        </h:dataTable>                                    
                                    </h:form>
                                </div>
                            </td>
                            <td align="left" style="width: 50%">

                                <div>

                                    <f:view>
                                        <h:form id="formClass">
                                            <p:dataTable id="dtClass" value="#{manageClass.list}" var="item" style="font-size: 80% !important"
                                                         paginator="true" rows="10"  
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                                         rowsPerPageTemplate="5,10,15" >
                                                <f:facet name="header">
                                                    <h:outputText value="MANAGE CLASS"/>
                                                </f:facet>
                                                <p:column>
                                                    <f:facet name="header">
                                                        <h:outputText value="ID"/>
                                                    </f:facet>
                                                    <h:outputText value="#{item.classID}"/>
                                                </p:column>
                                                <p:column>
                                                    <f:facet name="header">
                                                        <h:outputText value="Name"/>
                                                    </f:facet>
                                                    <h:outputText value="#{item.className}"/>
                                                </p:column>
                                                <p:column>
                                                    <f:facet name="header">
                                                        <h:outputText value="CreateDate"/>
                                                    </f:facet>
                                                    <h:outputText value="#{item.createDate}">
                                                        <f:convertDateTime pattern="MM/dd/yyyy" timeZone="GMT+7" />
                                                    </h:outputText>
                                                </p:column>
                                                <p:column>
                                                    <f:facet name="header">
                                                        <h:outputText value="StartDate"/>
                                                    </f:facet>
                                                    <h:outputText value="#{item.startDate}">
                                                        <f:convertDateTime pattern="MM/dd/yyyy" timeZone="GMT+7" />
                                                    </h:outputText>
                                                </p:column>
                                                <p:column>
                                                    <f:facet name="header">
                                                        <h:outputText value="EndDate"/>
                                                    </f:facet>
                                                    <h:outputText value="#{item.endDate}">
                                                        <f:convertDateTime pattern="MM/dd/yyyy" timeZone="GMT+7"/>
                                                    </h:outputText>
                                                </p:column>
                                                <p:column>
                                                    <f:facet name="header">
                                                        <h:outputText value="Option"/>
                                                    </f:facet>
                                                    <center>  
                                                        <p:commandButton oncomplete="editDialog.show()" update=":editForm" icon="ui-icon-pencil">
                                                            <f:setPropertyActionListener value="#{item}" target="#{manageClass.c}" />  
                                                        </p:commandButton>&nbsp;&nbsp;  
                                                        <p:commandButton action="#{manageClass.delete()}" icon="ui-icon-trash" onclick="return confirm('Are you sure?')">
                                                            <f:setPropertyActionListener value="#{item}" target="#{manageClass.c}" />  
                                                        </p:commandButton>
                                                    </center>
                                                </p:column>
                                            </p:dataTable>

                                        </h:form>
                                        <h:form id="editForm">
                                            <p:dialog header="Edit Class" widgetVar="editDialog" resizable="false" id="editClassDlg"  
                                                      showEffect="fade" hideEffect="explode" modal="true">  
                                                <p:growl id="mgsEditClass" showDetail="true"/>
                                                <h:inputHidden value="#{manageClass.c.classID}"/>
                                                <h:panelGrid columns="2">
                                                    <h:outputLabel value="ID:" for="classID" />
                                                    <h:outputText id="classID" value="#{manageClass.c.classID}" title="ClassID"/>
                                                    <h:outputLabel value="Name:" for="className" />
                                                    <h:inputText id="className" value="#{manageClass.c.className}" title="ClassName" required="true" requiredMessage="Name can't be empty!" />
                                                    <h:outputLabel value="CreateDate:" for="createDate" />
                                                    <p:calendar value="#{manageClass.c.createDate}" navigator="true"/> 
                                                    <h:outputLabel value="StartDate:" for="startDate" />
                                                    <p:calendar value="#{manageClass.c.startDate}" navigator="true"/>
                                                    <h:outputLabel value="EndDate:" for="endDate" />
                                                    <p:calendar value="#{manageClass.c.endDate}" navigator="true"/>
                                                    <p:commandButton update="mgsEditClass" value="Update" action="#{manageClass.update()}" type="submit"/>
                                                    <p:commandButton update=":formClass" oncomplete="editDialog.hide()" value="Close"/>
                                                </h:panelGrid>
                                            </p:dialog>
                                        </h:form>
                                        <h:form id="addForm">
                                            <p:commandButton oncomplete="addDialog.show()" value="Add" icon="ui-icon-plusthick"/>
                                            <p:dialog header="Create New Class" widgetVar="addDialog" resizable="false" id="addClassDlg"  
                                                      showEffect="fade" hideEffect="explode" modal="true">
                                                <p:growl id="mgsAddClass" showDetail="true"/>
                                                <h:panelGrid columns="2">
                                                    <h:outputLabel value="Name:" for="className" />
                                                    <h:inputText id="className" value="#{manageClass.c1.className}" title="ClassName" required="true" requiredMessage="Name can't be empty !" />
                                                    <h:outputLabel value="CreateDate:" for="createDate" />
                                                    <p:calendar value="#{manageClass.c1.createDate}" navigator="true"/> 
                                                    <h:outputLabel value="StartDate:" for="startDate" />
                                                    <p:calendar value="#{manageClass.c1.startDate}" navigator="true"/>
                                                    <h:outputLabel value="EndDate:" for="endDate" />
                                                    <p:calendar value="#{manageClass.c1.endDate}" navigator="true"/>
                                                    <p:commandButton update="mgsAddClass" value="Add" actionListener="#{manageClass.insert()}"/>
                                                    <p:commandButton update=":formClass" oncomplete="addDialog.hide()" value="Close"/>
                                                </h:panelGrid>
                                            </p:dialog>
                                        </h:form>
                                    </f:view>

                                </div>
                            </td>
                            <td align="left" style="width: 20%">
                                <div><center>
                                        <p:calendar value="#{calendarBean.date1}" mode="inline"/> 
                                    </center>
                                    <br/>
                                    <table width="100%">
                                        <tr style="height: 30px" valign="top">
                                            <td style="background-image: url(../image/star.gif)" >
                                                <span class="a1Link" style="margin-left: 10%">LINK</span>                                                             
                                            </td>
                                        </tr>
                                        <tr  valign="middle">
                                            <td  align="left">
                                                <img src="../image/gtk-media-play-ltr.png" style="margin-left:20%"/><a href="http://svfpt.net" class="a1Link">Forum of FPT University</a> <br/>                                                               
                                                <img src="../image/gtk-media-play-ltr.png" style="margin-left:20%"/><a href="http://mail.fpt.edu.vn" class="a1Link">Mail of FPT University</a><br/>                                                                                                            
                                                <img src="../image/gtk-media-play-ltr.png" style="margin-left:20%"/><a href="http://gre.ac.uk" class="a1Link">Website University of Greenwich</a> <br/>                                                                                                           
                                                <img src="../image/gtk-media-play-ltr.png" style="margin-left:20%"/><a href="http://aptech.vn" class="a1Link">Website of aptech world wide</a><br/>                                                                                                            
                                            </td>
                                        </tr>
                                    </table>
                                    <br/>
                                    <table border="0">
                                        <tr style="height: 30px" valign="top">
                                            <td style="background-image: url(../image/pencil.gif)" >
                                                <span class="a1Link" style="margin-left: 10%">ANNOUNCEMENT</span>                                                            
                                            </td>
                                        </tr>
                                        <tr style="height: 30px" valign="top">
                                            <td align="center">
                                                <span class="a1Link">Mọi thắc mắc xin liên hệ GC0503, ThangLNGC00073@fpt.edu.vn</span>
                                            </td>
                                        </tr>                                    
                                    </table>
                                </div>                           
                            </td>
                        </tr>                    
                    </table>
                    <hr/>
                    <center>
                        <p class="a1Link">
                            Design by Group 4 - Class GC0503<br/>
                            FPT University - Detech building, 8 - Ton That Thuyet, Cau Giay, HN.</p>
                    </center>
                </div>
            </center>
        </h:body>

    </f:view>
</html>



